home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
4.2
/
arexx
/
editor
/
startupscripts
/
maxvidlength.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1998-04-16
|
3KB
|
99 lines
/* MaxVidLength.rexx V3.5 -- Maximize only video clip in and out points */
/* By Bob Caron (Grue) ©1995 NewTek Inc. */
arg frompopup
if frompopup="" then frompopup=0
call remlib('PROJECT_REXX_PORT')
call addlib('PROJECT_REXX_PORT',0)
call set_view(2)
call req_error("Max VidLength V3.5 --- Maximize only video croutons.")
done=0
do while done=0
selection=req_tell("Max VidLength V3.5","'Continue' to effect ALL croutons","'Cancel' to effect selected croutons")
done=1
if selection=0 & frompopup=0 then do
if req_tell("Error:","You can only use this feature if you","launch this script from the tools","popup menu.")=0 then call quit()
done=0
end
end
if selection=1 then frompopup=0 else frompopup=1
project_end=croutonsinproject()
location=1
do count=1 to project_end
if croutonselectedpos(count)=1 | frompopup=0 then do
selected.location=count-1
location=location+1
end
end
location=location-1
vidin=0;vidout=0;audin=0;audout=0;done=-1
buttons='1111'
do while done=-1
buttons=req_buttons("What would you like to maximize:",buttons,"Video In","Video Out","Audio In","Audio Out")
if buttons="CANCEL" then call quit
if substr(buttons,1,1)="1" then do
vidin=1; done=1
end
if substr(buttons,2,1)="1" then do
vidout=1; done=1
end
if substr(buttons,3,1)="1" then do
audin=1; done=1
end
if substr(buttons,4,1)="1" then do
audout=1; done=1
end
end
if frompopup="0" then do
if req_tell("Change ALL In and Out points"," Are You Sure?")=0 then call quit()
end
else
if req_tell("Change Selected In and Out points"," Are You Sure?")=0 then call quit()
extravid=0
extraaud=0
call req_open("Working... Please wait.")
chunk=100/location;last=0;dots=0
do count=1 to location
if crnumtype(selected.count)="CLIP" then do
if vidout=1 then call crnumsettag(selected.count,Duration,crnumGetTag(selected.count,RecFields))
if audout=1 then call crnumsettag(selected.count,AudioDuration,crnumGetTag(selected.count,RecFields))
if vidin=1 then call crnumsettag(selected.count,ClipStartField,0)
if audin=1 then call crnumsettag(selected.count,AudioStart,0)
end
last=trunc(dots/10)+1
dots=dots+chunk;string=copies(".",trunc(dots/10)+1)
if (last~=trunc(dots/10)+1) then do
if (11-length(string)>-1) then
call req_error("[Working"||string||right(' ',11-length(string))||"]")
end
end
call req_close()
call req_error("All done.")
call projectupdate()
call remlib("PROJECT_REXX_PORT")
exit
quit:
call req_error("Canceled.")
call remlib("PROJECT_REXX_PORT")
exit
croutonselectedpos:
arg pos
row=trunc(pos/8)
col=pos-(row*8)
row=row+1
return croutonselected(row,col)